package net.xuele.learn.pic;

public class Add10K {

    private long count = 0;
    synchronized long get() {
        System.out.println(Thread.currentThread().getName() + "--get");
        return count;
    }
    synchronized void set(long v) {
        count = v;
        System.out.println(Thread.currentThread().getName()+"--set");
    }
    void add10K(){
        int idx = 0;
        while(idx++< 1) {
            set(get()+1);
        }
    }
}
